package com.bigfish.gbs.enums;

/**
 * 统一格式，状态码，提示信息
 * Created by Joycessh
 * 11/25/18 8:36 PM
 */
public enum ResultEnum {
    UNKOWN_ERROR(-1, "未知错误"),

    BAD_REQUEST(400, "错误请求"),
    NOT_FOUND(404, "请求的资源不存在"),
    METHOD_NOT_ALLOWED(405, "禁止访问"),
    INTERNAL_SERVER_ERROR(500, "服务器内部错误"),

    FAIL(1000, "失败"),
    ERROR_USER(1001, "帐号或密码不正确"),
    LOAD_ROLE_ERROR(1002, "该账号没有登录权限"),

    SUCCESS(2000, "成功"),
    ;

    private Integer code;

    private String msg;

    ResultEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}